package com.javastudy.liuhouse.xml_json;

import java.util.List;
import java.util.Objects;

public class Book {
    public Long id;
    public String name;
    public String author;
    public String isbn;
    public List<String> tags;
    public String pubDate;

    //空的构造对象是不能少的
    public Book() {
    }

    public Book(Long id, String name, String author, String isbn, List<String> tags, String pubDate) {
        this.id = id;
        this.name = name;
        this.author = author;
        this.isbn = isbn;
        this.tags = tags;
        this.pubDate = pubDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Book book = (Book) o;
        return Objects.equals(id, book.id) && Objects.equals(name, book.name) && Objects.equals(author, book.author) && Objects.equals(isbn, book.isbn) && Objects.equals(tags, book.tags) && Objects.equals(pubDate, book.pubDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, author, isbn, tags, pubDate);
    }

    public Long getId() {
        return id;
    }


    public void setId(Long id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public void setPubDate(String pubDate) {
        this.pubDate = pubDate;
    }

    public String getName() {
        return name;
    }

    public String getAuthor() {
        return author;
    }

    public String getIsbn() {
        return isbn;
    }

    public List<String> getTags() {
        return tags;
    }

    public String getPubDate() {
        return pubDate;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", isbn='" + isbn + '\'' +
                ", tags=" + tags +
                ", pubDate='" + pubDate + '\'' +
                '}';
    }
}
